package com.collectionday03demo;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class SortIntegerDemo {
    public static void main(String[] args) {
        Random r = new Random();
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            int j = r.nextInt(100)+ 1;
            list.add(j);
        }
        System.out.println(list);

        //集合排序 从小到大
        Collections.sort(list);
        System.out.println(list);

        //集合反转
        Collections.reverse(list);
        System.out.println(list);



    }
}
